package websocket.enum_;

/**
 * 解状态
 * @author nieruijie
 * @date 2022/5/21 19:16
 */
public enum SolStatEnum {

    SOL_COMPUTED(0, "已解出"),
    INSUFFICIENT_OBS(1, "观测数据不足"),
    NO_CONVERGENCE(2, "无法收敛"),
    COV_TRACE(4, "协方差矩阵的迹超过最大值（迹>1000 米）");

    private Integer index;

    private String msg;

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    SolStatEnum(Integer index, String msg) {
        this.index = index;
        this.msg = msg;
    }

    public static String getMsgByIndex(int index) {
        for (SolStatEnum item : SolStatEnum.values()) {
            if (item.index == index) {
                return item.msg;
            }
        }
        return null;
    }
}
